<!DOCTYPE html>

<fieldset>
    <legend>Lorem</legend>
</fieldset>

<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
if (window.testRunner)
    testRunner.waitUntilDone();

runAfterLayoutAndPaint(function() {
    document.querySelector('legend').innerText += ' ipsum dolor sit amet';
    runAfterLayoutAndPaint(function() {
        if (window.testRunner)
            testRunner.notifyDone();
    });
});
</script>
